STR:
	.string "/bin/bash"
	.byte	'\0'
DIR:
	.string "dirname\0"

NULL:
	.byte	'\0'

.global main
main:
#	call _print
#	call _execve
#	call _mkdir
	call _rmdir
	jmp _exit

.global _exit
_exit:
	xor	%eax,%eax			# clear eax
	inc %eax				# set to 1
	xor %ebx, %ebx			# clear arg of exit
	int $0x80				# call exit()

.global _print
_print:
	push	%ebx			# store ebx
	mov		$4, %eax		# print
	mov		$1, %ebx		# stdout
	mov		$STR, %ecx		# puts( STR )
	mov		$11,  %edx		# strlen( STR )
	int		$0x80
	pop		%ebx
	ret

.global _execve
_execve:
	push	%ebx			# store ebx
	mov		$11, %eax		# execve
	mov		$STR, %ebx		# "/bin/bash"
	mov		$(STR), %ecx		# $("/bin/bash")
	mov		$NULL, %edx		# NULL
	int		$0x80			# call kernel
	pop		%ebx
	ret

.global	_mkdir
_mkdir:
	push	%ebx			# store ebx
	mov		$39, %eax		# mkdir
	mov		$DIR, %ebx		# dir name
	mov		$0, %ecx		# mode
	int		$0x80			# call kerenel
	pop		%ebx
	ret

.global	_rmdir
_rmdir:
	push	%ebx			# store ebx
	mov		$40, %eax		# rmdir
	mov		$DIR, %ebx		# dir name
	int		$80				# call kernel
	pop		%ebx
	ret

